<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Welcome</title>
    <base th:href="${#httpServletRequest.getContextPath()} + '/'">
    <!-- 引入 layui.css -->
    <link rel="stylesheet" th:href="@{layui/css/layui.css}" href="../static/layui/css/layui.css">
    <!-- 引入 layui.js -->
    <script th:src="@{layui/layui.js}" src="../static/layui/layui.js"></script>
    <link rel="stylesheet" th:href="@{css/welcome.css}" href="../static/css/welcome.css">

    <style>
        .layui-card {
            border: 1px solid #f2f2f2;
            border-radius: 5px;
        }

        .icon {
            margin-right: 10px;
            color: #1aa094;
        }

        .icon-blue {
            color: #1e9fff !important;
        }

        .layui-bg-custom {
            background-color: #99cccc !important;
        }

        .icon-tip {
            color: #ff5722 !important;
        }

        .layuimini-qiuck-module {
            text-align: center;
            margin-top: 10px
        }

        .layuimini-qiuck-module a i {
            display: inline-block;
            width: 100%;
            height: 60px;
            line-height: 60px;
            text-align: center;
            border-radius: 2px;
            font-size: 30px;
            background-color: #F8F8F8;
            color: #333;
            transition: all .3s;
            -webkit-transition: all .3s;
        }

        .layuimini-qiuck-module a cite {
            position: relative;
            top: 2px;
            display: block;
            color: #666;
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
            font-size: 14px;
        }

        .panel {
            background-color: #fff;
            border: 1px solid transparent;
            border-radius: 3px;
            -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
            box-shadow: 0 1px 1px rgba(0, 0, 0, .05)
        }

        .panel-body {
            padding: 10px
        }

        .panel-title {
            margin-top: 0;
            margin-bottom: 0;
            font-size: 12px;
            color: inherit
        }

        .label {
            display: inline;
            padding: .2em .6em .3em;
            font-size: 75%;
            font-weight: 700;
            line-height: 1;
            color: #fff;
            text-align: center;
            white-space: nowrap;
            vertical-align: baseline;
            border-radius: .25em;
            margin-top: .3em;
        }

        .main_btn > p {
            height: 40px;
        }

        .layui-bg-number {
            background-color: #F8F8F8;
        }
    </style>
</head>
<body style="width: 98%">
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md8">
                <div class="layui-row layui-col-space15">
                    <div class="layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header"><i class="fa fa-warning icon"></i>数据统计</div>
                            <div class="layui-card-body">
                                <div class="layui-row layui-col-space10">
                                    <div class="layui-col-xs6">
                                        <div class="panel layui-bg-number layui-bg-custom">
                                            <div class="panel-body">
                                                <div class="panel-title">
                                                    <span class="label pull-right layui-bg-blue">实时</span>
                                                    <h5>用户数</h5>
                                                </div>
                                                <div class="panel-content">
                                                    <h1 class="no-margins" th:text="${userCount}">2451</h1>
                                                    <small>当前分类总记录数</small>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-col-xs6">
                                        <div class="panel layui-bg-number layui-bg-red">
                                            <div class="panel-body">
                                                <div class="panel-title">
                                                    <span class="label pull-right layui-bg-green">实时</span>
                                                    <h5>教师数</h5>
                                                </div>
                                                <div class="panel-content">
                                                    <h1 class="no-margins" th:text="${teacherCount}">2451</h1>
                                                    <small>当前分类总记录数</small>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-col-xs6">
                                        <div class="panel layui-bg-number layui-bg-cyan">
                                            <div class="panel-body">
                                                <div class="panel-title">
                                                    <span class="label pull-right layui-bg-red">实时</span>
                                                    <h5>学生数</h5>
                                                </div>
                                                <div class="panel-content">
                                                    <h1 class="no-margins" th:text="${studentCount}">2451</h1>
                                                    <small>当前分类总记录数</small>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-col-xs6">
                                        <div class="panel layui-bg-number layui-bg-orange">
                                            <div class="panel-body">
                                                <div class="panel-title">
                                                    <span class="label pull-right layui-bg-cyan">实时</span>
                                                    <h5>院系数</h5>
                                                </div>
                                                <div class="panel-content">
                                                    <h1 class="no-margins" th:text="${departmentCount}">214</h1>
                                                    <small>当前分类总记录数</small>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-col-xs6">
                                        <div class="panel layui-bg-number layui-bg-blue">
                                            <div class="panel-body">
                                                <div class="panel-title">
                                                    <span class="label pull-right layui-bg-orange">实时</span>
                                                    <h5>课程数</h5>
                                                </div>
                                                <div class="panel-content">
                                                    <h1 class="no-margins" th:text="${courseCount}">214</h1>
                                                    <small>当前分类总记录数</small>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-col-xs6">
                                        <div class="panel layui-bg-number layui-bg-green">
                                            <div class="panel-body">
                                                <div class="panel-title">
                                                    <span class="label pull-right layui-bg-blue">实时</span>
                                                    <h5>在线人数</h5>
                                                </div>
                                                <div class="panel-content">
                                                    <h1 class="no-margins" th:text="${onlineCount}">214</h1>
                                                    <small>当前分类总记录数</small>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header"><i class="fa fa-credit-card"></i>快捷入口</div>
                            <div class="layui-card-body">
                                <div class="layui-row layui-col-space10 layuimini-qiuck">
                                    <div class="layui-col-xs3 layuimini-qiuck-module"
                                         th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.originalUser.role} eq '学生'">
                                        <a href="javascript:checkCourseResults()" data-title="已选课程"
                                           data-icon="fa fa-window-maximize">
                                            <i class="fa fa-window-maximize layui-icon layui-icon-search layui-bg-blue"></i>
                                            <cite>已选课程</cite>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs3 layuimini-qiuck-module"
                                         th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.originalUser.role} eq '学生'">
                                        <a href="javascript:checkCourses()" data-title="查看课程"
                                           data-icon="fa fa-window-maximize">
                                            <i class="fa fa-window-maximize layui-icon layui-icon-search layui-bg-green"></i>
                                            <cite>选课退选</cite>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs3 layuimini-qiuck-module"
                                         th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.originalUser.role} eq '教师'">
                                        <a href="javascript:checkLectures();" data-title="我的课程" data-icon="fa fa-gears">
                                            <i class="fa fa-gears layui-icon layui-icon-search layui-bg-blue"></i>
                                            <cite>我的课程</cite>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs3 layuimini-qiuck-module"
                                         th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.originalUser.role} eq '教师'">
                                        <a href="javascript:inputScore();" data-title="录入成绩" data-icon="fa fa-gears">
                                            <i class="fa fa-gears layui-icon layui-icon-add-1 layui-bg-green"></i>
                                            <cite>录入成绩</cite>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs3 layuimini-qiuck-module"
                                         th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.originalUser.role} eq '管理员'">
                                        <a href="javascript:checkUsers()" data-title="用户信息" data-icon="fa fa-file-text">
                                            <i class="fa fa-file-text layui-icon layui-icon-search layui-bg-custom"></i>
                                            <cite>用户信息</cite>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs3 layuimini-qiuck-module"
                                         th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.originalUser.role} eq '管理员'">
                                        <a href="javascript:checkTeachers()" data-title="教师信息"
                                           data-icon="fa fa-calendar">
                                            <i class="fa fa-calendar layui-icon layui-icon-search layui-bg-red"></i>
                                            <cite>教师信息</cite>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs3 layuimini-qiuck-module"
                                         th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.originalUser.role} eq '管理员'">
                                        <a href="javascript:checkStudents()" data-title="学生信息"
                                           data-icon="fa fa-calendar">
                                            <i class="fa fa-calendar layui-icon layui-icon-search layui-bg-cyan"></i>
                                            <cite>学生信息</cite>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs3 layuimini-qiuck-module"
                                         th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.originalUser.role} eq '管理员'">
                                        <a href="javascript:checkDepartments()" data-title="院系信息"
                                           data-icon="fa fa-calendar">
                                            <i class="fa fa-calendar layui-icon layui-icon-search layui-bg-orange"></i>
                                            <cite>院系信息</cite>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs3 layuimini-qiuck-module"
                                         th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.originalUser.role} eq '管理员'">
                                        <a href="javascript:checkCourses()" data-title="课程信息"
                                           data-icon="fa fa-dot-circle-o">
                                            <i class="fa fa-dot-circle-o layui-icon layui-icon-search layui-bg-blue"></i>
                                            <cite>课程信息</cite>
                                        </a>
                                    </div>
                                    <div class="layui-col-xs3 layuimini-qiuck-module"
                                         th:if="${session.SPRING_SECURITY_CONTEXT.authentication.principal.originalUser.role} eq '管理员'">
                                        <a href="javascript:checkLectures()" data-title="授课信息"
                                           data-icon="fa fa-hourglass-end">
                                            <i class="fa fa-hourglass-end layui-icon layui-icon-search layui-bg-green"></i>
                                            <cite>授课信息</cite>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md12">
                        <div class="panel panel-default">
                            <div class="layui-carousel" id="carousel" lay-filter="carousel">
                                <div carousel-item="">
                                    <div><img th:src="@{/images/carousel/1.jpeg}" alt="1" width="100%" height="484px">
                                    </div>
                                    <div><img th:src="@{/images/carousel/2.jpeg}" alt="2" width="100%" height="409px">
                                    </div>
                                    <div><img th:src="@{/images/carousel/3.jpeg}" alt="3" width="100%" height="453px">
                                    </div>
                                    <div><img th:src="@{/images/carousel/4.jpeg}" alt="4" width="100%" height="438px">
                                    </div>
                                    <div><img th:src="@{/images/carousel/5.jpeg}" alt="5" width="100%" height="545px">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-col-md4">
                <div class="layui-card">
                    <div class="layui-card-header"><i class="fa fa-bullhorn icon icon-tip"></i>
                        <div class="layui-inline">
                            <span>即将上课&nbsp;&nbsp;</span>
                            <i class="layui-icon layui-icon-speaker"></i>
                            <div style="position: absolute; top: 0; left: 100px; width: 280px; color: cornflowerblue">
                                <marquee behavior="scroll" direction="left" scrollamout="10" scrooldelay="10">
                                    [[${message}]]
                                </marquee>
                            </div>
                        </div>
                    </div>
                    <div class="layui-card-body">
                        <div style="height: 372px;">
                            <table class="layui-table">
                                <colgroup>
                                    <col width="100">
                                    <col width="190">
                                    <col width="100">
                                </colgroup>
                                <thead>
                                <tr>
                                    <th style="text-align: center">授课老师</th>
                                    <th style="text-align: center">课程名称</th>
                                    <th style="text-align: center">授课时间</th>
                                </tr>
                                </thead>
                                <tbody class="layui-text">
                                <tr style="text-align: center" th:each="lectureVO:${lectureVOList}">
                                    <td th:text="${lectureVO.teacherName}">王建新</td>
                                    <td th:text="${lectureVO.courseName}">Web开发技术</td>
                                    <td th:text="${#dates.format(lectureVO.date, 'MM-dd HH:mm')}">07-01 08:00</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

                <div class="layui-card">
                    <div class="layui-card-header"><i class="fa fa-fire icon"></i>版本信息</div>
                    <div class="layui-card-body layui-text">
                        <table class="layui-table">
                            <colgroup>
                                <col width="100">
                                <col>
                            </colgroup>
                            <tbody>
                            <tr>
                                <td>软件名称</td>
                                <td>
                                    教务管理系统
                                </td>
                            </tr>
                            <tr>
                                <td>框架名称</td>
                                <td>
                                    layui
                                </td>
                            </tr>
                            <tr>
                                <td>主要特色</td>
                                <td>零门槛 / 响应式 / 清爽 / 极简</td>
                            </tr>
                            <tr>
                                <td>当前版本</td>
                                <td>v1.0.0</td>
                            </tr>
                            <tr>
                                <td>指导老师</td>
                                <td>

                                </td>
                            </tr>
                            <tr>
                                <td>开发人员</td>
                                <td>
                                    @Gerrit / @Corey
                                </td>
                            </tr>
                            <tr>
                                <td>Gitee</td>
                                <td style="padding-bottom: 0;">
                                    <div class="layui-btn-container">
                                        <a href="https://gitee.com/zhongshaofa/layuimini" target="_blank"
                                           style="margin-right: 15px"><img
                                                src="https://gitee.com/zhongshaofa/layuimini/badge/star.svg?theme=dark"
                                                alt="star"></a>
                                        <a href="https://gitee.com/zhongshaofa/layuimini" target="_blank"><img
                                                src="https://gitee.com/zhongshaofa/layuimini/badge/fork.svg?theme=dark"
                                                alt="fork"></a>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>Github</td>
                                <td style="padding-bottom: 0;">
                                    <div class="layui-btn-container">
                                        <iframe src="https://ghbtns.com/github-btn.html?user=zhongshaofa&repo=layuimini&type=star&count=true"
                                                frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
                                        <iframe src="https://ghbtns.com/github-btn.html?user=zhongshaofa&repo=layuimini&type=fork&count=true"
                                                frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                <div class="layui-card">
                    <div class="layui-card-header"><i class="fa fa-paper-plane-o icon"></i>作者心语</div>
                    <div class="layui-card-body layui-text layadmin-text">
                        <p>本模板基于layui2.5.4以及font-awesome-4.7.0进行实现。layui开发文档地址：<a
                                class="layui-btn layui-btn-xs layui-btn-danger" target="_blank"
                                href="http://www.layui.com/doc">layui文档</a></p>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use(['carousel'], function () {
        const carousel = layui.carousel;

        //改变下时间间隔、动画类型、高度
        carousel.render({
            elem: '#carousel'
            , interval: 3000
            , anim: 'fade'
            , height: '409px'
            , width: '840px'
        });
    });

    layui.use(['layer', 'jquery', 'form'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            form = layui.form

    });
</script>
<script>
    function checkCourseResults() {
        let a = layui.$(window.parent.document.getElementById('checkCourseResults'));
        a[0].click()
    }

    function checkCourses() {
        let a = layui.$(window.parent.document.getElementById('checkCourses'));
        a[0].click()
    }

    function checkUsers() {
        let a = layui.$(window.parent.document.getElementById('checkUsers'));
        a[0].click()
    }

    function checkTeachers() {
        let a = layui.$(window.parent.document.getElementById('checkTeachers'));
        a[0].click()
    }

    function checkStudents() {
        let a = layui.$(window.parent.document.getElementById('checkStudents'));
        a[0].click()
    }

    function checkDepartments() {
        let a = layui.$(window.parent.document.getElementById('checkDepartments'));
        a[0].click()
    }

    function checkLectures() {
        let a = layui.$(window.parent.document.getElementById('checkLectures'));
        a[0].click()
    }

    function inputScore() {
        let a = layui.$(window.parent.document.getElementById('inputScore'));
        a[0].click()
    }
</script>
</html>